package com.xinyue.fishinghunter.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Service;

import com.xinyue.fishinghunter.dao.entity.FishingHunterAccount;
import com.xinyue.fishinghunter.dao.repository.FishingHunterAccountRepository;
import com.xinyue.framework.dao.AbstractDao;
import com.xinyue.framework.dao.redis.CommonRedisKeyConifg;
import com.xinyue.framework.dao.redis.IRedisKeyConfig;
@Service
public class FishingHunterAccountDao extends AbstractDao<FishingHunterAccount, Long> {
	@Autowired
	private FishingHunterAccountRepository fishingHunterAccountRepository;
	@Override
	protected IRedisKeyConfig getRedisKey() {
		return CommonRedisKeyConifg.USER_ACCOUNT;
	}

	@Override
	protected MongoRepository<FishingHunterAccount, Long> getMongoRepository() {
		return fishingHunterAccountRepository;
	}

	@Override
	protected Class<FishingHunterAccount> getEntityClass() {
		return FishingHunterAccount.class;
	}
	
	public FishingHunterAccount findByAccount(String account) {
		return fishingHunterAccountRepository.findByAccount(account);
	}

}
